home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / textfiles / ftpfaq.txt < prev    next >
Text File  |  1994-11-23  |  17KB  |  494 lines

  1.  
  2. Last update: 21-Sep-94
  3.   - New FTP site list (Chapter 3)
  4.   - Downloading large files (Chapter 9)
  5.  
  6. 0. Contents
  7. ===========
  8. 1. Introduction
  9. 2. FTP command list
  10. 3. Important sites
  11. 4. A Sample Session
  12. 5. The .netrc File
  13. 6. Archivers
  14. 7. The Archie Database
  15. 8. Mailservers
  16. 9. Transferring to Amiga
  17.  
  18.  
  19.  
  20. 1. Introduction
  21. ===============
  22.  
  23. FTP stands for File Transfer Protocol.  The program with the same name,
  24. 'ftp', allows you to gain access to some other machines and store and/or
  25. retrieve files.  If you have a UNIX account on a machine with Internet
  26. access, and the machine has the 'ftp' command, you're almost done.  If not,
  27. you have to get the files by mail:  see the section 'Mailservers', below.
  28.  
  29. In this document, we refer to two computers:
  30.  
  31. o    The 'local machine' is the computer that you are physically logged
  32.     in on.
  33.  
  34. o    The 'remote machine' is the computer that you are contacting via
  35.     your local machine.  It might be right next door, or thousands of
  36.     kilometers away!  Using 'ftp', you can transfer files from the
  37.     remote machine to your local machine, or from your local machine to
  38.     the remote machine.
  39.  
  40. Normally, one needs an account on a remote machine to use it.  However, a
  41. number of machines on the Internet allow anybody to log in as the user 'ftp'
  42. or 'anonymous'.  When you log in using the anonymous account, you'll be
  43. prompted for a password.  You should type your local login name as the
  44. password, especially when you upload.  After doing so, you may retrieve all
  45. files found in public areas on the remote machine.  Doing this is
  46. commonly called 'using anonymous ftp' or 'doing some anonymous ftp-ing'.
  47.  
  48. The ftp program gives you a prompt that looks like this:
  49.  
  50.         ftp>
  51.  
  52. At this prompt, you can type commands to connect to remote machines, upload
  53. and download files, etc.
  54.  
  55.  
  56.  
  57. 2. FTP command List
  58. ===================
  59.  
  60. Here are some important commands you'll need within ftp.  In these examples,
  61. any words given inside angled brackets <like this> are like variables
  62. that stand for particular values.  For example, the command
  63.  
  64.             get <remote file name>
  65.  
  66. means you should type the word "get" followed by the name of a file that
  67. is on the remote machine.  An actual example would be:
  68.  
  69.             get SuperProgram.lha
  70.  
  71. Commands For Opening And Closing FTP Connections:
  72.  
  73.     open <site>
  74.  
  75.         Connects to a remote machine.  For valid sites, see below.
  76.  
  77.     close
  78.         Closes connection to the remote site
  79.  
  80.     bye
  81.         Quits FTP.
  82.  
  83.     quit
  84.         Same as bye.
  85.  
  86. Commands For Setting The Transfer Mode
  87.         
  88.     bin
  89.  
  90.         Sets the connection to binary mode for transferring non-text
  91.         files, such as "lha", "lzh", "zoo", "arc", "dms", "zom", "Z"
  92.         (compressed), "gz", "tar", and other archives.  See the
  93.         "Archivers" section below.
  94.  
  95.     asc
  96.         Sets the connection to text (ASCII) mode for transferring
  97.         text files.
  98.  
  99.     It is OK to transfer text files in "bin" mode.  However, it is
  100.     WRONG to transfer binary files in "asc" mode -- they will get all
  101.     messed up.  So to be safe, you can just type "bin" at the beginning
  102.     of each ftp session and leave it that way.  (However, "asc" mode
  103.     is faster for text files.)
  104.  
  105. Commands For Downloading (Getting, Receiving) Files:
  106.  
  107.     get <remote file name>
  108.  
  109.         Receives the named remote file.  This command cannot
  110.         transfer multiple files at a time; for that, see "mget".
  111.  
  112.         If you specify a second argument, it will be used as the
  113.         name for the local file.  (By default, the local file has
  114.         the same name as the remote file.)
  115.  
  116.     mget <remote file 1> <remote file 2> ...
  117.  
  118.         Receives all the above remote files with a single command.
  119.  
  120.     mget <pattern>
  121.  
  122.         Receives all the remote files whose names match <pattern>.
  123.         Patterns may include the symbols
  124.  
  125.             *    stands for any sequence of characters
  126.             ?    stands for any 1 character
  127.  
  128.         For example, if you wanted to download all files that
  129.         begin with "B" and end with ".lzh", type:
  130.  
  131.             mget B*.lzh
  132.  
  133.         To download all files whose names are exactly 4 characters
  134.         long, type:
  135.  
  136.             mget ????
  137.  
  138.         You will be prompted before each file is downloaded.
  139.         To turn off this prompting, see the "prompt" command below.
  140.  
  141. Commands For Uploading (Putting, Sending) Files
  142.  
  143.     put <local file name>
  144.  
  145.         Transmits the local file to the remote machine.
  146.         This works for only one file at a time, similarly to the
  147.         way "get" works.
  148.  
  149.         If you specify a second argument, it will be used as the
  150.         name for the remote file.  (By default, the remote file has
  151.         the same name as the local file.)
  152.  
  153.     mput <local file 1> <local file 2> ...etc.
  154.  
  155.         Transmits all the above local files to the remote machine
  156.         with a single command.
  157.  
  158.     mget <pattern>
  159.  
  160.         Transmits all local files whose names match the given
  161.         pattern.  See the "mget" command, above, for information
  162.         about patterns.
  163.  
  164. Additional Commands For Uploading And Downloading
  165.  
  166.     prompt
  167.  
  168.         Normally, mget and mput will prompt you before transferring
  169.         each file.  If you don't like this, the 'prompt' command
  170.         toggles the prompting on and off.
  171.  
  172.     hash
  173.  
  174.         Normally, files are downloaded silently.  Typing the 'hash'
  175.         command will cause a 'hash mark' to be printed every so
  176.         often, indicating how much downloading has completed so far.
  177.         Typing this command again toggles the hash marks on and off.
  178.  
  179. Commands For Exploring The Local And Remote Machines
  180.  
  181.     Files on the remote machine (and probably your local machine too)
  182.     are organized in directories.  Here is how to navigate those
  183.     directories and view their contents.
  184.  
  185.     dir <pattern>
  186.  
  187.         Lists files in the current directory of the remote machine.
  188.         See "mget", above, for information about patterns.
  189.  
  190.     ls <pattern>
  191.  
  192.         Same as "dir", but list the files in a short format.
  193.  
  194.     cd <directory name>
  195.  
  196.         Changes your current directory on the remote machine.
  197.  
  198.     lcd <directory name>
  199.  
  200.         Changes your current directory on the local machine
  201.  
  202.     mkdir <directory name>
  203.  
  204.         Creates a new directory on the remote machine.  This will
  205.         not work if you do not have permission to do it on the
  206.         remote machine.
  207.  
  208. Some Special And Helpful Functions
  209.  
  210. o    There are some special arguments you can add to the 'get' command.
  211.     If you type:
  212.  
  213.             get myfile -
  214.  
  215.     then file 'myfile' will be displayed on your screen instead of
  216.     downloaded.  If you would like this file to be displayed one
  217.     screen at a time, pausing after each screenful, type
  218.  
  219.             get myfile |more
  220.  
  221.     [NOTE -- NO SPACE BETWEEN THE '|' and 'more'].  This latter command
  222.     may not work on all remote machines.
  223.  
  224. o    Also note that the ls and dir commands take only one argument.  This
  225.     can be either an option or a pattern, BUT NOT BOTH.  If you give a
  226.     second argument, this will be interpreted as a local filename, and
  227.     the directory listing will be stored in that local file instead of
  228.     displayed on your screen.
  229.  
  230.  
  231. 3. Important Sites
  232. ==================
  233.  
  234. Location    Name                     Address         Directory
  235. --------    ----                     -------         ---------
  236. USA (MO)     ftp.wustl.edu            128.252.135.4   pub/aminet/
  237. USA (CA)     ftp.cdrom.com            192.216.222.5   pub/aminet/
  238. USA (TX)     ftp.etsu.edu             192.43.199.20   pub/aminet/
  239. USA (WI)     ftp.netnet.net           198.70.64.3     pub/aminet/
  240. Scandinavia  ftp.luth.se              130.240.18.2    pub/aminet/
  241. Switzerland  ftp.eunet.ch             146.228.10.16   pub/aminet/
  242. Switzerland  ftp.math.ethz.ch         129.132.104.6   pub/aminet/
  243. Switzerland  litamiga.epfl.ch         128.178.151.32  pub/aminet/
  244. Germany      ftp.uni-paderborn.de     131.234.2.32    pub/aminet/
  245. Germany      ftp.uni-erlangen.de      131.188.3.2     pub/aminet/
  246. Germany      ftp.uni-bielefeld.de     129.70.4.55     pub/aminet/
  247. Germany      ftp.uni-oldenburg.de     134.106.40.9    pub/aminet/
  248. Germany      ftp.uni-kl.de            131.246.9.95    pub/aminet/
  249. Germany      ftp.uni-stuttgart.de     129.96.8.13     pub/aminet/
  250. Germany      ftp.uni-siegen.de        141.99.128.1    pub/aminet/
  251. Germany      ftp.cs.tu-berlin.de      130.149.17.7    pub/aminet/
  252. Germany      ftp.stud.fh-heilbronn.de 141.7.1.41      pub/aminet/
  253. Germany      ftp.tu-chemnitz.de       192.108.33.193  pub/aminet/
  254. UK           ftp.doc.ic.ac.uk         146.169.2.1     pub/aminet/
  255. UK           micros.hensa.ac.uk       148.88.8.84     pub/aminet/
  256.    (*) closed 6:30am to 4pm weekdays
  257.  
  258.  
  259. The above group of sites together are called 'Aminet'.  They all contain the
  260. same files (through a process called 'mirroring'), although most of them
  261. delete older files.  Also, there are a lot of other Amiga FTP sites around, 
  262. and when make announcments about software on these sites, they usually give 
  263. the site address.
  264.  
  265. Finland      ftp.funet.fi            128.214.6.100   pub/amiga/
  266. USA          ftp.isca.uiowa.edu      128.255.21.233  amiga/fx
  267. USA          ftp.hawaii.edu          128.171.44.70   pub/amiga/fish
  268. Scandinavia  ftp.funet.fi            128.214.248.6   pub/amiga/fish
  269.  
  270. Both ftp.cso.uiuc.edu and grind.isca.uiowa.edu have a full collection of
  271. Fish Disks as their main feature.  Whenever I mention a program that is to
  272. be retrieved from a Fish disk, you can get it there.
  273.  
  274.  
  275.  
  276. 4. A Sample Session
  277. ===================
  278.  
  279. This is an example FTP session.  What you have to type is given in square
  280. brackets, on a line by itself, like this:
  281.  
  282.    [Here is something that you would type]
  283.  
  284. Everything else is displayed by the computer.  FTP output is often preceded
  285. by strange numbers like "220" and "150" -- you can ignore these.
  286. The example begins here.
  287.  
  288.    [ftp]
  289.  
  290. ftp> 
  291.      [open wuarchive.wustl.edu]
  292. Connected to wuarchive.wustl.edu.
  293. 220 amiga FTP server (Version 5.60.97 Wed Dec 9 22:23:21 MET 1992) ready.
  294. Name (amiga:umueller): 
  295.                        [ftp]
  296. 331 Guest login ok, send your userid as password.
  297. Password:
  298.           [kdalton]
  299. 230- Welcome to amiga.physik anonymous FTP server
  300. 230-      .....
  301. 230 Guest login ok, access restrictions apply.
  302. ftp> 
  303.      [cd pub/aminet]
  304. 250 CWD command successful.
  305. ftp> 
  306.      [get RECENT |more]
  307. 200 PORT command successful.
  308. 150 Opening ASCII mode data connection for RECENT (5676 bytes).
  309. | Recent uploads to wuarchive.wustl.edu [130.60.80.80] on 11-Dec-1992
  310. | The last 7 days' uploads, newest first. Blank line=new day, + = long .readme
  311. |
  312. |File                Dir        Size Description
  313. |------------------- ---        ---- -----------
  314. tiff2iff.lha         gfx/conv     7K Converts TIFF files to Amiga IFF
  315. DNetIRCpic.lzh       comm/net    16K Demo picture of DNet IRC
  316. DNetIRC.lha          comm/net    88K+IRC intuition DNet client (dnetlib.o neede
  317. ICoons_Nofp.lzh      gfx/3d     172K+Spline based object modeller (no 68881 nee
  318. 1993.lha             mods/u4ia  109K+ProTracker Module By U4ia called '1993'
  319. skick321.lha         os20/util   37K+Soft-kicker under OS 2.0 - new release
  320. monoxyde.dms         demo/mega  477K+MONOXYDE - new demo by Vanish
  321. baudbandit1.4b.lha   comm/misc   16K+Version 1.4b of baudbandit.device
  322. jed206b.lha          util/edit  144K+programmable, programmers editor. OS2.0+
  323. --More--
  324.          [q]
  325. 226 Transfer complete.
  326. local: |more remote: RECENT
  327. 5763 bytes received in 4.5 seconds (1.2 Kbytes/s)
  328. ftp> 
  329.      [cd game/think]
  330. 250 CWD command successful.
  331. ftp> 
  332.      [bin]
  333. 200 Type set to I.
  334. ftp> 
  335.      [get t-triz.lzh]
  336. 200 PORT command successful.
  337. 150 Opening BINARY mode data connection for t-triz.lzh (56496 bytes).
  338. 226 Transfer complete.
  339. local: t-triz.lzh remote: t-triz.lzh
  340. 56496 bytes received in 0.43 seconds (1.3e+02 Kbytes/s)
  341. ftp> 
  342.      [bye]
  343. 221 Goodbye.
  344.  
  345. This is the end of of the sample session.
  346.  
  347. If you're looking for something specific on that site, check the appropriate
  348. directory (using the 'cd' and 'ls' commands), or download the remote files
  349. 'INDEX', 'LOCAL' or 'ls-lR.Z'.  You can then use a program such as the UNIX
  350. 'grep' to search for filenames in them.  (Type 'man grep' in the UNIX shell
  351. to learn about grep).
  352.  
  353.  
  354. 5. The .netrc File
  355. ==================
  356.  
  357. If you put a file named .netrc in your home directory on the local machine,
  358. it will make your ftp life easier.  Just put into this file all information
  359. about how to log in at your favourite FTP site, and it'll be done
  360. automatically when you ftp to that site.
  361.  
  362. After you create the .netrc file, you have to 'chmod 600 .netrc' or it won't
  363. be accepted:
  364.  
  365.         cd
  366.         chmod 600 .netrc
  367.  
  368. Here's an example .netrc file to log onto the machine wuarchive.wustl.edu.
  369. It also defines a macro called 'init' that turns on binary mode and changes
  370. your remote directory to pub/aminet.  To use this macro after you are logged
  371. into the remote machine, just type
  372.  
  373.         $init
  374.  
  375. machine wuarchive.wustl.edu
  376. login ftp
  377. password kdalton
  378. macdef init
  379. bin
  380. cd pub/aminet
  381.  
  382.  
  383. Make sure you put a blank line after the last command, or else it won't work
  384. properly.  Also, remember to set the password to your login name.
  385.  
  386.  
  387. 6. Archivers
  388. ============
  389.  
  390. Most files on FTP sites store their files in archived (compressed) format.
  391. You can recognize the archiver used by the ending of the file name.  These
  392. are the most important ones:
  393.  
  394. Suffix  Archiver        Filename on Aminet
  395.  
  396. ..lzh    LhA             LhA_e138.run
  397. ..lha    LhA             LhA_e138.run
  398. ..zoo    Zoo             zoo2-10.lzh
  399. ..zip    Zip             unzip-4.1.lzh
  400. ..dms    DMS             dms111.sfx
  401. ..run    (LhA)           -
  402. ..sfx    (LhA)           -
  403. ..tar.Z  tar, compress   tar-compress.lzh
  404. ..gz    GNU Zip        gzip124x.lha
  405.  
  406. The AmigaDOS versions of those archivers can be found on the AmiNet sites
  407. (see above) in the directory pub/aminet/util/arc, except for GNU Zip which
  408. is found in pub/aminet/util/pack.  To give you a start, LhA is also stored
  409. in self-extracting form (.run or .sfx).  Just execute it to extract it.
  410.  
  411. UNIX versions of most of these archivers are available.  You can get them
  412. from wuarchive.wustl.edu in the directory /pub/aminet/misc/unix/, or if
  413. they're not there, use archie (see below) to find them. The files names are:
  414.  
  415. LhA  lha-1.00.tar.Z  
  416. Zoo  zoo-2.10.tar.Z
  417. Zip  unzip41.tar.Z
  418. Dms  dmscheck.c.Z
  419.  
  420.  
  421. 7. The Archie Database
  422. ======================
  423.  
  424. There is a database of all files on all FTP sites worldwide, called 'archie'.
  425. They have a mailserver, a telnet service, and a client software.  Telnet to
  426. archie.sura.net and log in as 'archie', or send mail containing HELP in its
  427. body to archie@quiche.cs.mcgill.ca.  You'll get more information that way.
  428.  
  429.  
  430. 8. Mailservers
  431. ==============
  432.  
  433. Some sites allow sending them magic mail messages which cause them to FTP
  434. things from other sites, uuencode them, and send them to you.  Others only
  435. send the files stored locally at that site.  Here are the most important mail
  436. servers.  Send a mail containing HELP in its body to find out more about them
  437. (note that the German links are slow, generally):
  438.  
  439. ftpmail@decwrl.dec.com
  440. mailserver@nic.funet.fi
  441. ftp-mailer@ftp.informatik.tu-muenchen.de
  442. mrcserv@janus.mtroyal.ab.ca
  443. mail-server@ftp.cs.tu-berlin.de
  444. mail-server@rtfm.mit.edu
  445.  
  446.  
  447. 9. Transferring to Amiga
  448. ========================
  449.  
  450. After you have the files on your UNIX account, you need to get the files
  451. home.  Most Amiga terminal programs have one or more ways to transfer files
  452. to your Amiga.  Read your terminal program documentation for more
  453. information.
  454.  
  455. One recommended method is to use ZModem.  If your local machine has the
  456. 'sz' command, and your terminal program supports ZModem, you are set.
  457. To download the file 'whatever.lzh' to your Amiga, type:
  458.  
  459.         sz whatever.lzh
  460.  
  461. and then use your terminal program to receive it.  If your site does not
  462. have 'sz', you can get it from krynn.efd.lth.se in the file
  463. /pub/modem/rzsz9107.tar.Z.  Compile it, or use archie to find a version
  464. specific for your UNIX flavor.
  465.  
  466. In the worst case, you can turn on your terminal program's "screen capture"
  467. feature and type:
  468.  
  469.     uuencode <filename filename
  470.  
  471. to get your file typed to the screen in 'uuencoded' format.  On your Amiga,
  472. uudecode the file (using uudecode from Fish Disk 92).  Also, some sites
  473. still use 'kermit'. If you have a program of that name, you can use one of
  474. the Amiga kermit implementations found on Aminet to get files home.
  475.  
  476. If you don't have a modem, you can try to find a workstation with 3.5"
  477. floppy drive.  Sun 4 computers have them.  There you can either use the
  478. program mtools (try 'man mcopy') to store the files in MSDOS format and
  479. retrieve them using MSH (Fish Disk 382) or CrossDOS (included with AmigaDOS
  480. 2.1 and higher), or you use gnu tar (UNIX version to be found on
  481. decuac.dec.com, /pub/binaries/gnutar-1.10.tar.Z) to store files on the disk
  482. in .tar format using the command 'gtar cfvM /dev/rfd0c'.  Then you restore
  483. the files with gnu gtar (found on wuarchive.wustl.edu, in the file
  484. pub/aminet/util/gnu/gtar110.lzh) and the FLAT device (Fish Disk 535) and MSH
  485. (or any other PC format reading tool).  Mount FLAT:, and then enter 'gtar
  486. xfvM flat:MSH' or replace the MSH by the name of your emulation tools.
  487.  
  488. If a file is too large to fit on a floppy, you can use misc/unix/bsplit*
  489. from Aminet to split it, and c:join under AmigaDOS to put it back together.
  490.  
  491. If you'd like some additional info to be included in this FAQ, contact
  492. umueller@wuarchive.wustl.edu.  -Urban Dominik Mueller
  493.  
  494.